<?php

define( "FIX_URL", str_replace(array('/app/webroot', '/index.php'), '', $_SERVER['SCRIPT_NAME']) );
define( "URL_BASE", "http://" . $_SERVER['HTTP_HOST'] . FIX_URL );

define('CURRENT_USER_ID', 'CURRENT_USER_ID');
define( "DEFAUL_STATUS",  4 );
define("DELETE_STATUS", 9);


// DEFINE FOLdER UPLOAD PUBLIC
define('UPLOAD_WEBROOT_FOLDER', ROOT . DS . APP_DIR . DS . 'webroot');
define('UPLOAD_FOLDER', ROOT . DS . APP_DIR . DS . 'webroot' . DS . 'uploads' . DS);

define('PUBLIC_IMAGE_THUMB', UPLOAD_FOLDER . 'thumbs' . DS);
define('PUBLIC_IMAGE_DETAIL', UPLOAD_FOLDER . 'details' . DS);

// show img
define('PUBLIC_THUMB_SHOW', FIX_URL."/uploads/thumbs/");
define('PUBLIC_DETAIL_SHOW', FIX_URL."/uploads/details/");

// Thumbnail
define('IMAGE_MAX_HEIGHT', 800);
define('IMAGE_MAX_WIDTH', 800);

define('THUMB_WIDHT', 400);
define('THUMB_HEIGHT', 400);
define('THUMB_SCALE', 0.262541806);

define('DETAIL_WIDHT', 420);
define('DETAIL_HEIGHT', 484);
define('DETAIL_SCALE', 0.702341137);

define('SUPPORT_EMAIL', 'no-reply@hatakua.com');
define('EMAIL_DOMAIN', 'hatakua.com');
define('REPLY_EMAIL', 'no-reply@hatakua.com');
define('NOREPLY_EMAIL', 'no-reply@hatakua.com');
define('BASE_NAME', 'HaTaKua');


//***************************************************************//
// Function : _SEO
//---------------------------------------------------------------//
// Params   : $string
//---------------------------------------------------------------//
// Return   : tieng viet khong dau
//---------------------------------------------------------------//
// Memo     :
//---------------------------------------------------------------//
// Version  :  Add ( tuanna ) ( Nov 19, 2008 )
//***************************************************************//
function _SEO($str) {
    if (strlen($str) == 0)
        return $str;
    $str = preg_replace("/(Ă |Ă¡|áº¡|áº£|Ă£|Ă¢|áº§|áº¥|áº­|áº©|áº«|Äƒ|áº±|áº¯|áº·|áº³|áºµ)/", 'a', $str);
    $str = preg_replace("/(Ă¨|Ă©|áº¹|áº»|áº½|Ăª|á»�|áº¿|á»‡|á»ƒ|á»…)/", 'e', $str);
    $str = preg_replace("/(Ă¬|Ă­|á»‹|á»‰|Ä©)/", 'i', $str);
    $str = preg_replace("/(Ă²|Ă³|á»�|á»�|Ăµ|Ă´|á»“|á»‘|á»™|á»•|á»—|Æ¡|á»�|á»›|á»£|á»Ÿ|á»¡)/", 'o', $str);
    $str = preg_replace("/(Ă¹|Ăº|á»¥|á»§|Å©|Æ°|á»«|á»©|á»±|á»­|á»¯)/", 'u', $str);
    $str = preg_replace("/(á»³|Ă½|á»µ|á»·|á»¹)/", 'y', $str);
    $str = preg_replace("/(Ä‘)/", 'd', $str);
    $str = preg_replace("/(Ă€|Ă�|áº |áº¢|Ăƒ|Ă‚|áº¦|áº¤|áº¬|áº¨|áºª|Ä‚|áº°|áº®|áº¶|áº²|áº´)/", 'A', $str);
    $str = preg_replace("/(Ăˆ|Ă‰|áº¸|áºº|áº¼|Ă�|á»€|áº¾|á»†|á»‚|á»„)/", 'E', $str);
    $str = preg_replace("/(ĂŒ|Ă�|á»�|á»ˆ|Ä¨)/", 'I', $str);
    $str = preg_replace("/(Ă’|Ă“|á»Œ|á»�|Ă•|Ă”|á»’|á»�|á»˜|á»”|á»–|Æ |á»œ|á»�|á»¢|á»�|á» )/", 'O', $str);
    $str = preg_replace("/(Ă™|Ă�|á»¤|á»¦|Å¨|Æ¯|á»ª|á»¨|á»°|á»¬|á»®)/", 'U', $str);
    $str = preg_replace("/(á»²|Ă�|á»´|á»¶|á»¸)/", 'Y', $str);
    $str = preg_replace("/(Ä�)/", 'D', $str);
    $str = preg_replace("/( )/", '-', $str);
    $str = preg_replace("/[^0-9a-zA-Z_\-]/", ' ', $str);
    return $str;
}

?>